﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;
using System.Web.Security;

namespace WordSmith_V1.Library.Security
{
    public class CustomPrincipal : IPrincipal
    {
        private FormsIdentity _identity;

        public CustomPrincipal(FormsIdentity identity)
        {
            _identity = identity;
        }

        public virtual bool IsInRole(string role)
        {
            //TODO use roles
            //Just return false for now
            //return _identity.Role.Split(',').Any(r => r == role);
            return false;
        }

        public IIdentity Identity
        {
            get { return _identity; }
        }
    }
}
